Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSL: New version 2.7.1 #5019

Merged
merged 3 commits into from
Jun 11, 2022
Merged

Conversation

eschnett
Copy link
Contributor

Do we need to increase the "official" version number to 2.7.2, or should we keep it at 2.7.1?

@giordano
Copy link
Member

I'd keep it to 2.7.1 🙂

@eschnett
Copy link
Contributor Author

This fails for the architecture aarch64-apple-darwin.

I investigated, and I don't understand why. Apparently the symbols in the libgslcblas library aren't found when libgsl is created. The library is there, and it has the correct symbols. Maybe Apple's linker behaves differently on aarch64 than on x86_64, and one needs to pass an additional option when creating libgsl. Ideally, this would happen via autotools and libtool, of course. Maybe updating these and running autoreconf would help?

This architecture isn't currently supported either. Would it be okay to disable it?

@giordano
Copy link
Member

Yes, I agree that ideally autotools should deal with this stuff. The weird thing is that v2.7.0 worked flawless. I'll try to have a look these days.

@eschnett
Copy link
Contributor Author

I didn't see a GSL_jll @2.7 for aarch64-apple-darwin either. Did I miss it?

@giordano
Copy link
Member

That's the "fake" v2.7.1: https://github.com/JuliaBinaryWrappers/GSL_jll.jl/blob/847c713027ebb947f26f2f140bd7cb86d222d2f2/README.md. It was actually 2.7.0, see the source.

@eschnett
Copy link
Contributor Author

Yes, I see it know. I accidentally looked at GSL @2.6.0+3.

@giordano
Copy link
Member

giordano commented Jun 11, 2022

Quick update: the failing command is

libtool: link: cc -dynamiclib  -o .libs/libgsl.27.dylib  .libs/version.o   -Wl,-force_load,block/.libs/libgslblock.a -Wl,-force_load,blas/.libs/libgslblas.a -Wl,-force_load,bspline/.libs/libgslbspline.a -Wl,-force_load,bst/.libs/libgslbst.a -Wl,-force_load,complex/.libs/libgslcomplex.a -Wl,-force_load,cheb/.libs/libgslcheb.a -Wl,-force_load,dht/.libs/libgsldht.a -Wl,-force_load,diff/.libs/libgsldiff.a -Wl,-force_load,deriv/.libs/libgslderiv.a -Wl,-force_load,eigen/.libs/libgsleigen.a -Wl,-force_load,err/.libs/libgslerr.a -Wl,-force_load,fft/.libs/libgslfft.a -Wl,-force_load,filter/.libs/libgslfilter.a -Wl,-force_load,fit/.libs/libgslfit.a -Wl,-force_load,histogram/.libs/libgslhistogram.a -Wl,-force_load,ieee-utils/.libs/libgslieeeutils.a -Wl,-force_load,integration/.libs/libgslintegration.a -Wl,-force_load,interpolation/.libs/libgslinterpolation.a -Wl,-force_load,linalg/.libs/libgsllinalg.a -Wl,-force_load,matrix/.libs/libgslmatrix.a -Wl,-force_load,min/.libs/libgslmin.a -Wl,-force_load,monte/.libs/libgslmonte.a -Wl,-force_load,multifit/.libs/libgslmultifit.a -Wl,-force_load,multifit_nlinear/.libs/libgslmultifit_nlinear.a -Wl,-force_load,multilarge/.libs/libgslmultilarge.a -Wl,-force_load,multilarge_nlinear/.libs/libgslmultilarge_nlinear.a -Wl,-force_load,multimin/.libs/libgslmultimin.a -Wl,-force_load,multiroots/.libs/libgslmultiroots.a -Wl,-force_load,ntuple/.libs/libgslntuple.a -Wl,-force_load,ode-initval/.libs/libgslodeiv.a -Wl,-force_load,ode-initval2/.libs/libgslodeiv2.a -Wl,-force_load,permutation/.libs/libgslpermutation.a -Wl,-force_load,combination/.libs/libgslcombination.a -Wl,-force_load,multiset/.libs/libgslmultiset.a -Wl,-force_load,poly/.libs/libgslpoly.a -Wl,-force_load,qrng/.libs/libgslqrng.a -Wl,-force_load,randist/.libs/libgslrandist.a -Wl,-force_load,rng/.libs/libgslrng.a -Wl,-force_load,roots/.libs/libgslroots.a -Wl,-force_load,siman/.libs/libgslsiman.a -Wl,-force_load,sort/.libs/libgslsort.a -Wl,-force_load,specfunc/.libs/libgslspecfunc.a -Wl,-force_load,movstat/.libs/libgslmovstat.a -Wl,-force_load,rstat/.libs/libgslrstat.a -Wl,-force_load,statistics/.libs/libgslstatistics.a -Wl,-force_load,sum/.libs/libgslsum.a -Wl,-force_load,sys/.libs/libgslsys.a -Wl,-force_load,test/.libs/libgsltest.a -Wl,-force_load,utils/.libs/libutils.a -Wl,-force_load,vector/.libs/libgslvector.a -Wl,-force_load,cdf/.libs/libgslcdf.a -Wl,-force_load,wavelet/.libs/libgslwavelet.a -Wl,-force_load,spmatrix/.libs/libgslspmatrix.a -Wl,-force_load,spblas/.libs/libgslspblas.a -Wl,-force_load,splinalg/.libs/libgslsplinalg.a  -lm  -g -O2   -install_name  /workspace/destdir/lib/libgsl.27.dylib -compatibility_version 28 -current_version 28.0 -Wl,-single_module
Undefined symbols for architecture arm64:
  "_cblas_caxpy", referenced from:
      _gsl_blas_caxpy in libgslblas.a(blas.o)
  "_cblas_ccopy", referenced from:
      _gsl_blas_ccopy in libgslblas.a(blas.o)
    [...]

Instead, on x86_64-darwin the compiler call is

cc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libgsl.27.dylib  .libs/version.o   -Wl,-force_load,block/.libs/libgslblock.a -Wl,-force_load,blas/.libs/libgslblas.a -Wl,-force_load,bspline/.libs/libgslbspline.a -Wl,-force_load,bst/.libs/libgslbst.a -Wl,-force_load,complex/.libs/libgslcomplex.a -Wl,-force_load,cheb/.libs/libgslcheb.a -Wl,-force_load,dht/.libs/libgsldht.a -Wl,-force_load,diff/.libs/libgsldiff.a -Wl,-force_load,deriv/.libs/libgslderiv.a -Wl,-force_load,eigen/.libs/libgsleigen.a -Wl,-force_load,err/.libs/libgslerr.a -Wl,-force_load,fft/.libs/libgslfft.a -Wl,-force_load,filter/.libs/libgslfilter.a -Wl,-force_load,fit/.libs/libgslfit.a -Wl,-force_load,histogram/.libs/libgslhistogram.a -Wl,-force_load,ieee-utils/.libs/libgslieeeutils.a -Wl,-force_load,integration/.libs/libgslintegration.a -Wl,-force_load,interpolation/.libs/libgslinterpolation.a -Wl,-force_load,linalg/.libs/libgsllinalg.a -Wl,-force_load,matrix/.libs/libgslmatrix.a -Wl,-force_load,min/.libs/libgslmin.a -Wl,-force_load,monte/.libs/libgslmonte.a -Wl,-force_load,multifit/.libs/libgslmultifit.a -Wl,-force_load,multifit_nlinear/.libs/libgslmultifit_nlinear.a -Wl,-force_load,multilarge/.libs/libgslmultilarge.a -Wl,-force_load,multilarge_nlinear/.libs/libgslmultilarge_nlinear.a -Wl,-force_load,multimin/.libs/libgslmultimin.a -Wl,-force_load,multiroots/.libs/libgslmultiroots.a -Wl,-force_load,ntuple/.libs/libgslntuple.a -Wl,-force_load,ode-initval/.libs/libgslodeiv.a -Wl,-force_load,ode-initval2/.libs/libgslodeiv2.a -Wl,-force_load,permutation/.libs/libgslpermutation.a -Wl,-force_load,combination/.libs/libgslcombination.a -Wl,-force_load,multiset/.libs/libgslmultiset.a -Wl,-force_load,poly/.libs/libgslpoly.a -Wl,-force_load,qrng/.libs/libgslqrng.a -Wl,-force_load,randist/.libs/libgslrandist.a -Wl,-force_load,rng/.libs/libgslrng.a -Wl,-force_load,roots/.libs/libgslroots.a -Wl,-force_load,siman/.libs/libgslsiman.a -Wl,-force_load,sort/.libs/libgslsort.a -Wl,-force_load,specfunc/.libs/libgslspecfunc.a -Wl,-force_load,movstat/.libs/libgslmovstat.a -Wl,-force_load,rstat/.libs/libgslrstat.a -Wl,-force_load,statistics/.libs/libgslstatistics.a -Wl,-force_load,sum/.libs/libgslsum.a -Wl,-force_load,sys/.libs/libgslsys.a -Wl,-force_load,test/.libs/libgsltest.a -Wl,-force_load,utils/.libs/libutils.a -Wl,-force_load,vector/.libs/libgslvector.a -Wl,-force_load,cdf/.libs/libgslcdf.a -Wl,-force_load,wavelet/.libs/libgslwavelet.a -Wl,-force_load,spmatrix/.libs/libgslspmatrix.a -Wl,-force_load,spblas/.libs/libgslspblas.a -Wl,-force_load,splinalg/.libs/libgslsplinalg.a  -lm  -g -O2   -install_name  /workspace/destdir/lib/libgsl.27.dylib -compatibility_version 28 -current_version 28.0 -Wl,-single_module

The only difference are the flags -Wl,-undefined -Wl,dynamic_lookup passed to the linker, which don't appear in the compiler call for aarch64-darwin. I'll need to understand why they're called differently.

Side note: I've just noticed that the new soversion of the library is 27. It used to be 25 in v2.7, that's an ABI breakage... At this point I fear it'd be better to keep the two versions separate 😕 Edit: it turns out the soversion of v2.7 was wrong: https://git.savannah.gnu.org/cgit/gsl.git/commit/configure.ac?id=77e7c7d008707dace56626020eaa6181912e9841. But according to the comments in configure.ac this isn't even the first time they get this wrong...

@giordano
Copy link
Member

And the reason why we get the wrong are probably these lines in aclocal.m4:

    darwin*) # darwin 5.x on
      # if running on 10.5 or later, the deployment target defaults
      # to the OS version, if on x86, and 10.4, the deployment
      # target defaults to 10.4. Don't you love it?
      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
	10.[[012]][[,.]]*)
	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
	10.*)
	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
      esac

Needless to say that they just don't know there are new version of macOS after 10:

sandbox:${WORKSPACE}/srcdir/gsl-2.7.1 # echo ${MACOSX_DEPLOYMENT_TARGET}
11.0

Sigh

Comment on lines +20 to +25
if [[ "${target}" == aarch64-apple-darwin* ]]; then
# aclocal.m4 has some lines where it expects `MACOSX_DEPLOYMENT_TARGET` to be up to
# version 10. Let's pretend to be 10.16, as many tools do to make old build systems
# happy.
export MACOSX_DEPLOYMENT_TARGET="10.16"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also explains why the previous build worked: before JuliaPackaging/BinaryBuilderBase.jl#217 we used to unconditionally set MACOSX_DEPLOYMENT_TARGET="10.8".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants